package java_class_work.week05;

import java.io.*;

/**
 * @Auther: admin
 * @Date: 2022/10/11 11:14
 * @Description: OutputStreamWriter
 */
public class OutputStreamDemo {
    public static void main(String[] args) {
        String fileName = ".\\src\\java_class_work\\iotest\\writer.txt";
        OutputStreamWriter opsw = null;
        try {
            opsw = new OutputStreamWriter(new FileOutputStream(fileName));
            String content = "是海洋的倒影--";
            opsw.write(content);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (opsw != null) opsw.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
